/*
 * Created on Feb 10, 2005
 * Created by dfhuynh
 */
package edu.mit.simile.longwell.query.project;

import java.util.Map;
import java.util.Set;

import com.hp.hpl.jena.rdf.model.Resource;

/**
 * @author dfhuynh
 */
public interface IProjection {
	/**
	 * Answer the set of values in this project.
	 * 
	 * @return
	 */
	public Set getValues();
	
	/**
	 * Answer the projected value of the given object.
	 * 
	 * @param object
	 * @return
	 */
	public Object getValue(Resource object);
	
	/**
	 * Answer all objects.
	 * 
	 * @return
	 */
	public Set getObjects();
	
	/**
	 * Answer the number of all objects.
	 * 
	 * @return
	 */
	public int countObjects();
	
	/**
	 * Answer the number of objects projected to the given value.
	 * 
	 * @param value
	 * @return
	 */
	public int countObjects(Object value);
	
	/**
	 * Answer the set of objects projected to the given value.
	 * 
	 * @param value
	 * @return
	 */
	public Set getObjects(Object value);
	
	/**
	 * Answer the number of objects projected to any of the given values.
	 * 
	 * @param values
	 * @return
	 */
	public int countObjectsWithValues(Set values);
	
	/**
	 * Answer the set of objects projected to any of the given values.
	 * 
	 * @param values
	 * @return
	 */
	public Set getObjectsWithValues(Set values);
	
	/**
	 * Answer a map from object to value for all the projected objects.
	 * @param objects
	 * @return
	 */
	public Map getObjectToValueMap();
	
	/**
	 * Answer the locale in which the projection has been made. Can be null.
	 * 
	 * @return
	 */
	public String getLocale();
	
	/**
	 * Answer a number from 0 to 1 indicating how unique the projected values
	 * are. Smaller result implies less unique.
	 * 
	 * @return
	 */
	public float getUniqueness();
	public String getProperty();
}
